package com.itcoon.cloud.framework.mybatis.metahandler;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;

public abstract class AbstractMetaObjectHandler implements MetaObjectHandler, Comparable<AbstractMetaObjectHandler> {

    protected abstract int getOrder();

    @Override
    public int compareTo(AbstractMetaObjectHandler h1) {
        if(h1 == this || h1.getOrder() == this.getOrder()){
            return 0;
        }else if(h1.getOrder() > this.getOrder()){
            return -1;
        }
        return 1;
    }
}
